/*******************************************************
> Copyright (C) 2024 ==IOT== All rights reserved.
> File Name: 1.c
> Author: wyf
> Website:www.lv1.org
> Created Time: 2024年08月06日 星期二 16时02分01秒
***************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <assert.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <math.h>
//函数声明

double ca_tan(double sin,double cos);
double ca_cos(double arg);
double ca_sin(double arg);



//全局变量
double arg = 180.0;

int main(int argc, const char* argv[])
{
	double sin = 0;
	double cos = 0;
	double result = 0;
	
	//定义函数指针
	typedef double (*fun)(double);
    fun  p = NULL;
	
	p = ca_sin;
	sin = (*p)(arg);
	
	p = ca_cos;
	cos = (*p)(arg);

	//结果
	result = ca_tan(sin,cos);
	printf("tan的结果是：%.2lf\n",result);

    return 0;
}
//计算正切
double ca_tan(double sin,double cos){
	//计算正切
	double tan = 0;
	tan = (sin/cos);
	return tan;

}

//计算cos
double ca_cos(double arg){
	double result = 0;
	//计算余弦
	result = cos(arg);
	return result;

}

//计算sin
double ca_sin(double arg)
{	
	double result = 0;
	//计算正弦
	result = sin(arg);
	return result;
}
